using UnityEngine;
using System.Collections;

public class AutoScale : MonoBehaviour {
	
	public float scaleMax,cycle;
	private float scaleValue;
	
	void Awake(){
		scaleMax = scaleMax/2;
		transform.root.position = new Vector3(transform.root.position.x,transform.root.position.y,0.5f);
	}
	
	// Update is called once per frame
	void Update () {
		scaleValue = Mathf.Sin(Time.timeSinceLevelLoad*cycle)*scaleMax;
		scaleValue = (1-scaleMax)+scaleValue;
		transform.localScale = new Vector3(scaleValue,scaleValue,1);
	}
}
